﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace BookReader
{
    class lsCommand:ICommand
    {
        void ICommand.Execute(string[] param)
        {
            DirectoryInfo dir = new DirectoryInfo(StaticData.workingDir);
            FileInfo[] fs = dir.GetFiles("*.txt");
            int Index = 1;
            foreach (FileInfo f in fs)
            {
                Console.WriteLine(Index + ":" + f.Name);
                Index++;
            }
            Console.WriteLine("提示：用命令op 序号 可以打开文件");
        }

        string ICommand.Help()
        {
            return "ls命令：显示当前工作目录下的txt文件";
        }
    }
}
